package com.edu.exam.enums.grading;

import com.edu.exam.enums.core.BaseEnum;

/**
 * 导出安全级别枚举
 */
public enum ExportSecurityLevel implements BaseEnum {
    PUBLIC("PUBLIC", "公开"),
    INTERNAL("INTERNAL", "内部"),
    CONFIDENTIAL("CONFIDENTIAL", "机密"),
    SECRET("SECRET", "秘密"),
    TOP_SECRET("TOP_SECRET", "绝密"),
    RESTRICTED("RESTRICTED", "限制"),
    SENSITIVE("SENSITIVE", "敏感"),
    NORMAL("NORMAL", "普通");

    private final String code;
    private final String description;

    ExportSecurityLevel(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public static ExportSecurityLevel fromCode(String code) {
        for (ExportSecurityLevel level : values()) {
            if (level.getCode().equals(code)) {
                return level;
            }
        }
        throw new IllegalArgumentException("Unknown export security level code: " + code);
    }

    @Override
    public String toString() {
        return description;
    }
}